using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text;
using System.Data; 
using yq.IBase; 
using yq.Dictionary; 
using yq.Basis; 
using yq.Model.Logic;
using System.Collections; 
using Db; 
using System.Data.Common;

namespace yq.Model.Base 
{
    ///<summary>
    /// Article_GoodsImage -  商品图片 - 对象基础类
    /// </summary>
    ///<typeparam name="T"></typeparam>
    public abstract class IArticleGoodsImage<T> :ModelBase<ArticleGoodsImage> where T : ArticleGoodsImage, new()
    {
        /// <summary>
        /// 写入主键值
        /// </summary>
        /// <param name="Id">主键</param>
        protected internal override void SetKeyValue(dynamic Id)
        {
            this.GoodsImageId = Id;
        }

        /// <summary>
        /// 获取主键值
        /// </summary>
        /// <returns></returns>
        protected internal override dynamic GetKeyValue()
        {
            return GoodsImageId;
        }

        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy) 
        {
           this.GoodsImageId=dy.GoodsImageId;
           this.ContentId=dy.ContentId;
           this.GoodsId=dy.GoodsId;
           this.FileId=dy.FileId;
           this.Sno=dy.Sno;
        } 

        #region 定义属性

     
         /// <summary>
        /// 流水号
        /// </summary>
        private String _GoodsImageId = "";
      
        /// <summary>
        /// 流水号
        /// </summary>
        public String GoodsImageId
        {
            get 
            {
              return   (this._GoodsImageId); 
            }

            set 
            {
                    _GoodsImageId= value;  
            }
        }
       
     
         /// <summary>
        /// 内容ID
        /// </summary>
        private String _ContentId = "";
      
        /// <summary>
        /// 内容ID
        /// </summary>
        public String ContentId
        {
            get 
            {
              return   (this._ContentId); 
            }

            set 
            {
                    _ContentId= value;  
            }
        }
       
     
         /// <summary>
        /// 商品ID
        /// </summary>
        private String _GoodsId = "";
      
        /// <summary>
        /// 商品ID
        /// </summary>
        public String GoodsId
        {
            get 
            {
              return   (this._GoodsId); 
            }

            set 
            {
                    _GoodsId= value;  
            }
        }
       
     
         /// <summary>
        /// 图片ID
        /// </summary>
        private String _FileId = "";
      
        /// <summary>
        /// 图片ID
        /// </summary>
        public String FileId
        {
            get 
            {
              return   (this._FileId); 
            }

            set 
            {
                    _FileId= value;  
            }
        }
       
     
         /// <summary>
        /// 图片排序
        /// </summary>
        private int _Sno =int.MinValue;
      
        /// <summary>
        /// 图片排序
        /// </summary>
        public int Sno
        {
            get 
            {
              return   (this._Sno); 
            }

            set 
            {
                    _Sno= value;  
            }
        }
       

      #endregion 定义属性 

          protected internal override void SetValue(ArticleGoodsImage info, DataRow row) 
          { 
               if (row == null) 
               { 
                 info.IsLoad = false; 
               }
               else 
               { 
                  info.IsLoad = true; 
                  
                  if(row["GoodsImageId"]!= DBNull.Value)
                  {
                  info.GoodsImageId=row["GoodsImageId"].ToString();
                 }
                 
                  
                  if(row["ContentId"]!= DBNull.Value)
                  {
                  info.ContentId=row["ContentId"].ToString();
                 }
                 
                  
                  if(row["GoodsId"]!= DBNull.Value)
                  {
                  info.GoodsId=row["GoodsId"].ToString();
                 }
                 
                  
                  if(row["FileId"]!= DBNull.Value)
                  {
                  info.FileId=row["FileId"].ToString();
                 }
                 
                  
                  if(row["Sno"]!= DBNull.Value)
                  {
                  info.Sno=Convert.ToInt32(row["Sno"]);
                 }
                 
               } 

          } 

        protected internal override void GetDbParameters(DbCommand comm, ArticleGoodsImage info, DbHelper cn) 
        { 
             
                cn.AddInParameter(comm, "@GoodsImageId", DbType.String,ParameterTool.GetObj( info._GoodsImageId )); 
            
             
                cn.AddInParameter(comm, "@ContentId", DbType.String,ParameterTool.GetObj( info._ContentId )); 
            
             
                cn.AddInParameter(comm, "@GoodsId", DbType.String,ParameterTool.GetObj( info._GoodsId )); 
            
             
                cn.AddInParameter(comm, "@FileId", DbType.String,ParameterTool.GetObj( info._FileId )); 
            
             
                cn.AddInParameter(comm, "@Sno", DbType.Int32,ParameterTool.GetObj( info._Sno )); 
            
        } 

    } 
} 